load("//bazel:fuzz_target.bzl", "java_fuzz_target_test")

# Mutator fuzz tests define a low `runs` to only start and iterate
# a few times via Bazel. Long running fuzzing is executed in CI Sense through
# the CI pipeline integration.

java_fuzz_target_test(
    name = "StringMutatorFuzzTest",
    srcs = ["StringMutatorFuzzTest.java"],
    fuzzer_args = [
        "--experimental_mutator",
        "-runs=1000",
    ],
    target_class = "com.code_intelligence.selffuzz.mutation.mutator.lang.StringMutatorFuzzTest",
    deps = [
        "//selffuzz:jazzer_selffuzz",
        "//selffuzz/src/test/java/com/code_intelligence/selffuzz:helpers",
        "//src/main/java/com/code_intelligence/jazzer/junit:fuzz_test",
        "@maven//:org_junit_jupiter_junit_jupiter_api",
        "@maven//:org_junit_jupiter_junit_jupiter_engine",
        "@maven//:org_junit_platform_junit_platform_launcher",
    ],
)

[java_fuzz_target_test(
    name = "FloatingPointMutatorFuzzTests_" + method,
    srcs = ["FloatingPointMutatorFuzzTests.java"],
    fuzzer_args = [
        "--experimental_mutator",
        "--target_method=" + method,
        "-runs=1000",
    ],
    target_class = "com.code_intelligence.selffuzz.mutation.mutator.lang.FloatingPointMutatorFuzzTests",
    deps = [
        "//selffuzz:jazzer_selffuzz",
        "//selffuzz/src/test/java/com/code_intelligence/selffuzz:helpers",
        "//src/main/java/com/code_intelligence/jazzer/junit:fuzz_test",
        "@maven//:org_junit_jupiter_junit_jupiter_api",
        "@maven//:org_junit_jupiter_junit_jupiter_engine",
        "@maven//:org_junit_platform_junit_platform_launcher",
    ],
) for method in [
    "floatMutatorTest",
    "doubleMutatorTest",
]]
